<template>
  <div slot="title" class="s-title">
    <div>{{title}}</div>
    <i class="el-icon-full-screen s-icon" v-if="!fullscreen" @click="setFull"></i>
    <i class="el-icon-copy-document s-icon" v-if="fullscreen" @click="setSmall"></i>
  </div>
</template>

<script>
export default {
  name: 'DialogTit',
  props: {
    title: {
      type: String
    },
    fullscreen: {
      type: Boolean
    }
  },
  methods: {
    setFull(){
      this.$emit('update:fullscreen', true)
    },
    setSmall(){
      this.$emit('update:fullscreen', false)
    }
  }
}
</script>

<style scoped>
.s-title{
  width: calc(100% - 20px);
  height: 24px;
  display: flex;
  align-items: center;
  color:white;
}
.s-icon{
  cursor: pointer;
  position: absolute;
  right: 40px;
  top:15px
}
</style>
